package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 学员对象 sys_student
 * 
 * @author ruoyi
 * @date 2025-01-06
 */
public class SysStudent extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long studentId;
    private Long userId;
    private Long deptId;
    private Long roomId;

    /** 照片 */
    private String photo;

    /** 姓名 */
    @Size(min = 0, max = 32, message = "用户昵称长度不能超过32个字符")
    @Excel(name = "姓名")
    private String studentName;

    /** 性别（0男 1女 2未知） */
    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
    private String sex;

    /** 身份证号 */
    @Size(min = 0, max = 18, message = "身份证号必须是18位字符")
    @Excel(name = "身份证号")
    private String idcard;

    /** 手机号 */
    @Size(min = 11, max = 11, message = "手机号码长度必须是11个字符")
    @Excel(name = "手机号")
    private String phone;

    /** 家庭住址 */
    @Excel(name = "家庭住址")
    private String address;

    /** 报名日期 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "报名日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date signDate;

    /** 家长姓名 */
    @Excel(name = "家长姓名")
    private String parentName;

    /** 家长电话 */
    @Excel(name = "家长电话")
    private String parentMobile;

    /** 部门对象 */
    @Excels({
            @Excel(name = "所属校区", targetAttr = "deptName", type = Excel.Type.EXPORT)
    })
    private SysDept dept;

    /** 所属班级 */
    @Excels({
            @Excel(name = "所属班级", targetAttr = "roomName", type = Excel.Type.EXPORT)
    })
    private SysRoom room;

    /** 所属课程 */
    @Excel(name = "所属课程")
    private String course;

    @Excels({
            @Excel(name = "班主任", targetAttr = "userName", type = Excel.Type.EXPORT)
    })
    private SysUser user;

    /** 入班时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "入班时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date joinTime;

    /** 状态（0在校 1请假 2流失） */
    @Excel(name = "状态", readConverterExp = "0=在校,1=请假,2=流失")
    private String status;

    /** 毕业院校 */
    @Excel(name = "毕业院校")
    private String graduateSchool;

    /** 出生日期 */
    private Date birthday;

    public void setStudentId(Long studentId) 
    {
        this.studentId = studentId;
    }

    public Long getStudentId() 
    {
        return this.studentId;
    }

    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }
    public Long getDeptId()
    {
        return this.deptId;
    }

    public Long getUserId()
    {
        return this.userId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public void setCourse(String course) 
    {
        this.course = course;
    }

    public String getCourse() 
    {
        return course;
    }

    public void setPhoto(String photo) 
    {
        this.photo = photo;
    }

    public String getPhoto() 
    {
        return photo;
    }

    public void setStudentName(String studentName) 
    {
        this.studentName = studentName;
    }

    @Xss(message = "学员姓名不能包含脚本字符")
    @Size(min = 0, max = 16, message = "学员姓名长度不能超过16个字符")
    public String getStudentName() 
    {
        return studentName;
    }

    public void setSex(String sex) 
    {
        this.sex = sex;
    }

    public String getSex() 
    {
        return sex;
    }

    public void setIdcard(String idcard) 
    {
        this.idcard = idcard;
    }

    @NotBlank(message = "身份证号不能为空")
    @Size(min = 0, max = 18, message = "身份证号名长度不能超过18个字符")
    public String getIdcard() 
    {
        return idcard;
    }

    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    @NotBlank(message = "手机号码不能为空")
    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
    public String getPhone() 
    {
        return phone;
    }

    public void setAddress(String address) 
    {
        this.address = address;
    }

    @Size(min = 0, max = 256, message = "家庭住址长度不能超过256个字符")
    public String getAddress() 
    {
        return address;
    }

    public void setGraduateSchool(String graduateSchool)
    {
        this.graduateSchool = graduateSchool;
    }

    public String getGraduateSchool() 
    {
        return graduateSchool;
    }

    public void setSignDate(Date signDate) 
    {
        this.signDate = signDate;
    }

    public Date getSignDate() 
    {
        return signDate;
    }

    public void setParentName(String parentName) 
    {
        this.parentName = parentName;
    }

    @Size(min = 0, max = 16, message = "家长姓名长度不能超过16个字符")
    public String getParentName() 
    {
        return parentName;
    }

    public void setParentMobile(String parentMobile) 
    {
        this.parentMobile = parentMobile;
    }

    @Size(min = 0, max = 11, message = "家长手机号码长度不能超过11个字符")
    public String getParentMobile() 
    {
        return parentMobile;
    }

    public void setJoinTime(Date joinTime)
    {
        this.joinTime = joinTime;
    }

    public Date getJoinTime() 
    {
        return joinTime;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setBirthday(Date birthday) 
    {
        this.birthday = birthday;
    }

    public Date getBirthday() 
    {
        return birthday;
    }

    public SysDept getDept()
    {
        if (dept == null)
        {
            dept = new SysDept();
        }
        return dept;
    }
    public SysRoom getRoom()
    {
        if (room == null)
        {
            room = new SysRoom();
        }
        return room;
    }

    public SysUser getUser()
    {
        if (user == null)
        {
            user = new SysUser();
        }
        return user;
    }
    public void setRoomId(Long roomId)
    {
        this.roomId = roomId;
    }

    public Long getRoomId()
    {
        return this.roomId;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("studentId", getStudentId())
            .append("deptId", getDeptId())
            .append("room", getRoom())
            .append("course", getCourse())
            .append("photo", getPhoto())
            .append("studentName", getStudentName())
            .append("sex", getSex())
            .append("idcard", getIdcard())
            .append("phone", getPhone())
            .append("address", getAddress())
            .append("graduateDept", getGraduateSchool())
            .append("signDate", getSignDate())
            .append("parentName", getParentName())
            .append("parentMobile", getParentMobile())
            .append("joinTime", getJoinTime())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("updateBy", getUpdateBy())
            .append("birthday", getBirthday())
            .toString();
    }
}
